The Extract Object History as Macro feature lets you extract macros that can be played to understand the history of an object or to create new objects from complex scenarios that make use of multiple tools.
When a new session is started or a session is loaded, the tag “Session started” is added to the Action log with the current date and time. This serves as the session ID. If objects are loaded, the identity of those objects (GUID) are written in a starting inventory in the Action log, with logger variable names.
The session history is saved whenever a session is saved, and includes everything from the end of the Action log up to the last “Session started” entry. The starting inventory is also saved, as well as the ending inventory, with the identity of the objects saved with the session (GUID) and the logger variable names. You should note that when a session is loaded, the past history is recovered and the history of the current session is kept as a separate history.
When an object history is extracted, the whole history of the session is taken from the end to the beginning, one session history at a time:
The full block is kept “as is”, unless only assignments are required, in which case the code is stripped to keep only pure assignments, or loading occurs, in which case the assignment is replaced by a call to an macro block with the UUID of the macro of the history of that object.
The declared input variables and the names found in the declared input variables collections are added in the set of dependent variables to look for in preceding blocks.
The declared input variables, the names of variables found in declared input variable collections, the declared outputs variables and the names of the variables found as assignments of declared output variable collections are added in a set of variables that could be deleted.
For example, you could experiment with a recipe that creates regions of interest within selected ranges and then overwrites them on a small portion of a dataset.
A macro is generated with the name “Filtered session history of session YYYY-MM-DD-HH-MM-SS for object xx”, where object xx is the item from which the history was extracted.
Note If your experiment was applied to a small portion of a dataset, you can remove the cropping block so that the logged operations are applied to the full dataset.
The preference, Keep object history, which is available in the Miscellaneous settings, lets you save an object's history in exported *.ORSObject formatted files. You should note that saving object histories can time-consuming and that the GUID of all objects is always preserved when a session is saved or loaded.